﻿<UserControl xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  x:Class="CoverFlowClient.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:app="clr-namespace:CoverFlowClient"
             xmlns:c="clr-namespace:DC.ControlLibrary;assembly=DC.ControlLibrary"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" >
    <UserControl.Resources>
        <app:UrlConverter x:Key="UrlConverter"/>
    </UserControl.Resources >
    <Grid x:Name="LayoutRoot" Background="White">
        

        <Grid x:Name="imageGrid" Visibility="Visible" Background="Black">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="500" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid Grid.Row="1">
                <Grid>
                    <Grid.OpacityMask>
                        <LinearGradientBrush EndPoint="0,.5" StartPoint="1,.5">
                            <GradientStop Color="#00000000" Offset="1"/>
                            <GradientStop Color="#FF000000" Offset="0.8"/>
                            <GradientStop Color="#FE000000" Offset="0.2"/>
                            <GradientStop Color="#00000000" Offset="0"/>
                        </LinearGradientBrush>
                    </Grid.OpacityMask>
                    <c:CoverFlowControl x:Name="flowControl2" CacheMode="BitmapCache" >
                        <c:CoverFlowControl.ItemTemplate>
                            <DataTemplate>
                                <Border CornerRadius="10" BorderBrush="#99444444" BorderThickness="2" Background="{Binding ImageUrl, Converter={StaticResource UrlConverter}}" >
                                    <Image Source="{Binding ImageUrl}" Opacity="0"  >
                                    </Image>
                                </Border>
                            </DataTemplate>
                        </c:CoverFlowControl.ItemTemplate>
                    </c:CoverFlowControl>
                </Grid>
            </Grid>
            <TextBlock Text="{Binding SelectedItem.Title, ElementName=flowControl2}" Foreground="White" HorizontalAlignment="Center" Grid.Row="2" Margin="5" FontSize="25" />
        </Grid>


        <Grid x:Name="menuGrid" Visibility="Collapsed">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="600" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid>
                <Image x:Name="trailerImage" Margin="20" Source="{Binding SelectedItem.ImageUrl, ElementName=flowControl}" Stretch="None" />
            </Grid>

            <Grid Grid.Column="1">
                <c:CoverFlowControl x:Name="flowControl" CacheMode="BitmapCache" DisplayMemberPath="Title" Orientation="Vertical" SpaceBetweenItems="30" SpaceBetweenSelectedItemAndItems="30" RotationAngle="0" Scale=".9" ItemRenderTransformOrigin="0,.5" >
                </c:CoverFlowControl>
            </Grid>
        </Grid>

    </Grid>
</UserControl>
